// ----------------------------------
// RSDK Project: Sonic 2 - Boss Attack Plus
// Script Description: Results
// Script Author: Tails LP
// ----------------------------------

//-------Aliases-------//

private alias object.value0 : object.timer
private alias object.value1 : start.fadeValue
private alias object.value2 : selection.current
private alias object.value3 : arrow.offset
private alias object.value4 : object.aniTileTImer
private alias object.value5 : object.aniTileFrame

// menu selections


//private alias 0 : 

// object states

private alias 0 : STARTING_UP
private alias 1 : FADE_IN
private alias 2 : CHAR_SELECT
private alias 3 : MENU_IDLE
private alias 4 : BACK_TO_MENU

// selections

// Game Modes

private alias 0 : BOTH
private alias 1 : S_ONE
private alias 2 : S_TWO

private alias saveRAM[494] : saved.bossGameMode //7B8 SData.bin
private alias saveRAM[495] : saved.bossType //7BC SData.bin
private alias saveRAM[496] : saved.BossMusic //7C0 SData.bin
private alias saveRAM[497] : saved.Character //7C4 SData.bin
private alias saveRAM[498] : saved.TimeLimit //7C8 SData.bin
private alias saveRAM[499] : saved.superMode //7CC SData.bin

private alias saveRAM[500] : bossAttackTime.SonicTails //7D0 SData.bin
private alias saveRAM[501] : bossAttackTime1.SonicTails //7D4 SData.bin
private alias saveRAM[502] : bossAttackTime2.SonicTails //7D8 SData.bin

private alias saveRAM[503] : bossAttackTime.Sonic //7DC SData.bin
private alias saveRAM[504] : bossAttackTime1.Sonic //7E0 SData.bin
private alias saveRAM[505] : bossAttackTime2.Sonic //7E4 SData.bin

private alias saveRAM[506] : bossAttackTime.Tails //7E8 SData.bin
private alias saveRAM[507] : bossAttackTime1.Tails //7EC SData.bin
private alias saveRAM[508] : bossAttackTime2.Tails //7F0 SData.bin

private alias saveRAM[509] : bossAttackTime.Knuckles //7F4 SData.bin
private alias saveRAM[510] : bossAttackTime1.Knuckles //7F8 SData.bin
private alias saveRAM[511] : bossAttackTime2.Knuckles //7FC SData.bin

private alias saveRAM[512] : bossAttackTime.KnucklesTails //800 SData.bin
private alias saveRAM[513] : bossAttackTime1.KnucklesTails //804 SData.bin
private alias saveRAM[514] : bossAttackTime2.KnucklesTails //808 SData.bin

private alias saveRAM[515] : bossAttackTime.SuperSonic //80C SData.bin
private alias saveRAM[516] : bossAttackTime1.SuperSonic //810 SData.bin
private alias saveRAM[517] : bossAttackTime2.SuperSonic //814 SData.bin

private alias saveRAM[518] : bossAttackTime.SuperTails //818SData.bin
private alias saveRAM[519] : bossAttackTime1.SuperTails //81C SData.bin
private alias saveRAM[520] : bossAttackTime2.SuperTails //820 SData.bin

private alias saveRAM[521] : bossAttackTime.SuperKnuckles //824 SData.bin
private alias saveRAM[522] : bossAttackTime1.SuperKnuckles //828 SData.bin
private alias saveRAM[523] : bossAttackTime2.SuperKnuckles //82C SData.bin

//-------Function declarations-------//

//-------Static Values-------//

//-------Tables-------//




//-------Functions-------//



event ObjectMain

end event

event ObjectDraw
//----------------------TIME------------------------------------

	temp0 = screen.xcenter
	temp0 -= 64
	temp1 = 96
	DrawSpriteScreenXY(10, temp0, temp1)

//----------------------Timer--------------------------

	arrayPos1 = 500
	temp4 = saved.Character
	temp4 *= 3
	arrayPos1 += temp4
	arrayPos1 += saved.bossGameMode
	
	temp3 = result.time
	temp3 /= 0x1770
	stage.minutes = temp3
	temp3 = result.time
	temp2 = 0x1770
	temp2 *= stage.minutes
	temp3 -= temp2
	temp3 /= 100
	stage.seconds = temp3
	stage.milliseconds = result.time

	temp4 = 268
	DrawNumbers(0, temp4, temp1, stage.minutes, 2, 8, 1)
	temp4 += 22
	DrawNumbers(0, temp4, temp1, stage.seconds, 2, 8, 1)
	temp4 += 26
	DrawNumbers(0, temp4, temp1, stage.milliseconds, 2, 8, 1)
	DrawSpriteScreenXY(11, 278, temp1)
end event

event ObjectStartup
	ReadSaveRAM()

	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(0, 0, 8, 11, 1, 50) 		// 00 Number 0
	SpriteFrame(0, 0, 8, 11, 10, 50) 		// 01 Number 1
	SpriteFrame(0, 0, 8, 11, 19, 50) 		// 02 Number 2
	SpriteFrame(0, 0, 8, 11, 28, 50) 		// 03 Number 3
	SpriteFrame(0, 0, 8, 11, 1, 62) 		// 04 Number 4
	SpriteFrame(0, 0, 8, 11, 10, 62) 		// 05 Number 5
	SpriteFrame(0, 0, 8, 11, 19, 62) 		// 06 Number 6
	SpriteFrame(0, 0, 8, 11, 28, 62) 		// 07 Number 7
	SpriteFrame(0, 0, 8, 11, 1, 74) 		// 08 Number 8
	SpriteFrame(0, 0, 8, 11, 10, 74) 		// 09 Number 9
	SpriteFrame(-16, 0, 32, 11, 1, 17)		// 10 TIME
	SpriteFrame(0, 0, 29, 4, 1, 45) 		// 11 ' "
end event

event RSDKDraw
    DrawSprite(0)
end event

event RSDKLoad
    LoadSpriteSheet("Global/Display.gif")
    SpriteFrame(-16, -16, 32, 32, 223, 172)
end event